From: Georges Basile Stavracas Neto Date: Thu, 8 Aug 2019 20:21:12 +0000 (-0300) Subject: dnd: Fix drag cancel animation scale X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~839^2^2~8 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=f76f30fd6a69d866d31c9e7a62af241fac7e4176;p=gnome-shell.git dnd: Fix drag cancel animation scale When a drag is cancelled and the source actor is visible, the drag actor is animated back to the source position. The scale that the drag actor will become is calculated as: scale = this._dragActor.width / sourceScaledWidth However, this is wrong; what we wanted to do is the opposite: scale = sourceScaledWidth / this._dragActor.width Fix the scale calculation to match the math above. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/671 --- diff --git a/js/ui/dnd.js b/js/ui/dnd.js index 6539443cd..786d65419 100644 --- a/js/ui/dnd.js +++ b/js/ui/dnd.js @@ -611,7 +611,7 @@ var _Draggable = class _Draggable { // Snap the clone back to its source [x, y] = this._dragActorSource.get_transformed_position(); let [sourceScaledWidth] = this._dragActorSource.get_transformed_size(); - scale = sourceScaledWidth ? this._dragActor.width / sourceScaledWidth : 0; + scale = sourceScaledWidth ? sourceScaledWidth / this._dragActor.width : 0; } else if (this._dragOrigParent) { // Snap the actor back to its original position within // its parent, adjusting for the fact that the parent